home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Applications / Macintosh Tracker 1.20 / source / Tracker Client Folder / CSpecificSamplingRate.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-05-18  |  1.1 KB  |  49 lines  |  [TEXT/KAHL]

  1. /* CSpecificSamplingRate.c */
  2.  
  3. #include "CSpecificSamplingRate.h"
  4. #include "CMyDocument.h"
  5. #include "LocationConstants.h"
  6. #include "CWindow.h"
  7. #include "CArray.h"
  8.  
  9. #define MINSAMPLINGRATE (8000)
  10. #define MAXSAMPLINGRATE (65535)
  11.  
  12.  
  13. void                CSpecificSamplingRate::ISpecificSamplingRate(CMyDocument* TheDocument,
  14.                             CWindow* TheWindow)
  15.     {
  16.         LongPoint            LocalStart,LocalExtent;
  17.  
  18.         Document = TheDocument;
  19.         GetRect(SpecificFreqTEID,&LocalStart,&LocalExtent);
  20.         INumberText(LocalStart,LocalExtent,applFont,9,TheWindow,TheWindow);
  21.     }
  22.  
  23.  
  24. void                CSpecificSamplingRate::StoreValue(void)
  25.     {
  26.         long            Temp;
  27.         SongRec        Song;
  28.  
  29.         if (Dirty && (Document->Selection != -1))
  30.             {
  31.                 Temp = GetValue();
  32.                 if (Temp < MINSAMPLINGRATE)
  33.                     {
  34.                         Temp = MINSAMPLINGRATE;
  35.                     }
  36.                 if (Temp > MAXSAMPLINGRATE)
  37.                     {
  38.                         Temp = MAXSAMPLINGRATE;
  39.                     }
  40.                 Document->ListOfSongs->GetElement(Document->Selection,&Song);
  41.                 if (Song.SamplingRateOverrideDefault && (Song.SamplingRate != Temp))
  42.                     {
  43.                         Document->SetSamplingRate(Temp);
  44.                     }
  45.                 SetValue(Temp);
  46.             }
  47.         inherited::StoreValue();
  48.     }
  49.